package com.pigotech.ptwo.UI.Activity;

import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;

import com.pigotech.ptwo.R;

public class HelpCenterActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_help_center);
        getStatusBarHeight();
        setStatusBar();
        initView();
    }

    /**
     * 获取系统状态栏高度
     */
    private void getStatusBarHeight() {
        //获取status_bar_height资源的ID
        int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            //根据资源ID获取响应的尺寸值
            statusBarHeight = getResources().getDimensionPixelSize(resourceId);
        }
    }
    /**
     *4.4系统以上开启沉浸式后应用标题防止与系统标题重叠
     */
    private void setStatusBar() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            findViewById(R.id.title_view_doc).setVisibility(View.VISIBLE);
            findViewById(R.id.title_view_doc).getLayoutParams().height = statusBarHeight;
//            findViewById(R.id.title_view).setVisibility(View.VISIBLE);
//            findViewById(R.id.title_view).getLayoutParams().height = statusBarHeight;
            //透明状态栏
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            //透明底部导航栏
//            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        }
    }

    private void initView() {

    }
}
